package com.aspose.words.examples;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Snippet {
	public static void main(String[] args) {
		System.out.println("请输入一个数A:");
		Scanner scanner = new Scanner(System.in);
		int num = scanner.nextInt(10);
		if (num <= 3) {
			System.out.println("输入的数非法");
			return;
		}
		List<Integer> result = new ArrayList<Integer>();
		for (int i = 2; i <= num - 1; i++) {
			result.add(Integer.valueOf(Long.toString(Long.valueOf(num),i)));
		}
		if (result.size() > 0) {
			Integer count = 0;
			for (Integer i : result) {
				count += i;
			}
			System.out.println("A从2道A-1进制之和的均值为:" + (count.toString()) +"/"+ String.valueOf(result.size()));
		}
	}
}
